/*
package com.yyds.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.glls.java2212.bo.StudentBo;
import com.glls.java2212.pojo.Student;
import com.glls.java2212.service.StudentService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

*/
/**
 * @date 2022/10/12
 * @desc
 *//*

@Component
@Scope("prototype")    // 注意 这个监听器要设置成多例
public class WebStudentListener extends AnalysisEventListener<StudentBo> {

    @Autowired
    StudentService studentService;

    @Override
    public void invoke(StudentBo data, AnalysisContext context) {
        System.out.println(data);
        //属性拷贝
        Student student = new Student();
        BeanUtils.copyProperties(data,student);
        studentService.addStudent(student);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {

    }
}
*/
